package com.zxl.observer;
/**
 * ����Ĺ۲���
 * ʵ�ֳ���۲�����Ҫ��ĸ��½ӿڣ��Ա������״̬�������״̬��Э��
 * @author zxl
 * 2016��7��12��
 */
public class ConcreteObserver implements Observer {

	private String name;
	private String observerState;
	private ConcreteSubject concreteSubject;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}


	public ConcreteSubject getConcreteSubject() {
		return concreteSubject;
	}

	public void setConcreteSubject(ConcreteSubject concreteSubject) {
		this.concreteSubject = concreteSubject;
	}

	public ConcreteObserver(ConcreteSubject concreteSubject,String name){
		this.concreteSubject = concreteSubject;
		this.name = name;
	}
	
	@Override
	public void update() {
		// TODO Auto-generated method stub
		observerState = concreteSubject.getSubjectState();
		System.out.println("�۲���"+name+"��״̬��"+observerState);
	}

}
